This is nothing.


In [0]:

This does nothing.


In [1]:
from IPython import display

This is an execute_result.


In [2]:
1 + 1


Out[2]:
2

This is a stdout stream.


In [3]:
print(1 + 1)


2

This is an execute_result and a stdout.


In [4]:
print(1 + 1)
1 + 1


2
Out[4]:
2

This is a stderr.


In [5]:
0 / 0


---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
<ipython-input-5-b761d17a0499> in <module>()
----> 1 0 / 0

ZeroDivisionError: integer division or modulo by zero

This is stderr and stdout.


In [6]:
print(1 + 1)
0/0


2
---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
<ipython-input-6-5947a2d28144> in <module>()
      1 print(1 + 1)
----> 2 0/0

ZeroDivisionError: integer division or modulo by zero

IPython.display

This is some HTML.


In [7]:
display.HTML("<h1>Some HTML</h1>")


Out[7]:

Some HTML

This uses multiple displays.


In [8]:
display.display(display.HTML("<h1>Some Other HTML</h1>"))
display.display(display.HTML("<h2>Yet Other HTML</h2>"))


Some Other HTML

Yet Other HTML


In [9]:
def test_a_thing():
    assert 1 == 0
test_a_thing()


---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-9-561e3f1e80c7> in <module>()
      1 def test_a_thing():
      2     assert 1 == 0
----> 3 test_a_thing()

<ipython-input-9-561e3f1e80c7> in test_a_thing()
      1 def test_a_thing():
----> 2     assert 1 == 0
      3 test_a_thing()

AssertionError: